<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<base href="<%=basePath%>">

<link rel="stylesheet" type="text/css" href="css/basic/nav/navigator.css" />

<script type="text/javascript">
	
	/** 生成 菜单 **/
	function createMenu(){
		var functionJsonStr = '${sessionLoginUser.functionJson}';

		var nowAction = '${functionActionName}';
		var nowK = '${functionActionKey}';
		
		var functionJson = eval(functionJsonStr);
		
		if(functionJson != null){
			var funBtnHtml = "";
			
			for(var i = 0; i<functionJson.length; i++){
				var oneFunction = functionJson[i];
				
				var actionUrl = oneFunction["actionUrl"];
				var actionValue = oneFunction["actionValue"];
				var k = oneFunction["k"];
				var functionName = oneFunction["functionName"];
				
				var activeClass = "";

				if(nowAction == actionValue && nowK == k){
					activeClass = "class='active'"
				}
				
				funBtnHtml = funBtnHtml + "<li>";
				funBtnHtml = funBtnHtml + "<a " + activeClass + " href='" + actionUrl + "'>" + functionName + "</a>";
				funBtnHtml = funBtnHtml + "</li>";
			}
			
			document.getElementById("navigatorUlId").innerHTML = funBtnHtml;
		}
	}
</script>

<!-- ========== 导航栏 ========== -->
<div class="navigatorMain">
	<div class="navigatorMenu">
		<ul id="navigatorUlId">
			
		</ul>
	</div>
</div>

<script type="text/javascript">
	createMenu();
</script>

